<div>
  <div class="searchItem">
    <label>关联活动：</label>
    <input nz-input placeholder="请输入活动ID/名称" [(ngModel)]="query.name"/>
  </div>
  <div class="searchItem">
    <label>订单编号：</label>
    <input nz-input placeholder="请输入订单编号" [(ngModel)]="query.okey"/>
  </div>
  <div class="searchItem">
    <label>用户身份：</label>
    <nz-select [(ngModel)]="query.userType" nzAllowClear nzPlaceHolder="请选择" [nzBackdrop]="true">
      <nz-option [nzValue]="0" nzLabel="游客"></nz-option>
      <nz-option [nzValue]="1" nzLabel="爱思用户"></nz-option>
    </nz-select>
  </div>
  <div class="searchItem">
    <label>订单状态：</label>
    <nz-select [(ngModel)]="query.orderState" nzAllowClear nzPlaceHolder="请选择" [nzBackdrop]="true">
<!--      <nz-option [nzValue]="11" nzLabel="待上门揽件"></nz-option>-->
<!--      <nz-option [nzValue]="13" nzLabel="物流运输中"></nz-option>-->
<!--      <nz-option [nzValue]="14" nzLabel="到货待验机"></nz-option>-->
      <nz-option [nzValue]="15" nzLabel="待确认交易"></nz-option>
      <nz-option [nzValue]="16" nzLabel="待打款"></nz-option>
      <nz-option [nzValue]="18" nzLabel="打款失败"></nz-option>
      <nz-option [nzValue]="19" nzLabel="打款完成"></nz-option>
<!--      <nz-option [nzValue]="20" nzLabel="揽件前取消"></nz-option>-->
      <nz-option [nzValue]="21" nzLabel="验机中"></nz-option>
      <nz-option [nzValue]="22" nzLabel="待退回"></nz-option>
      <nz-option [nzValue]="23" nzLabel="退回途中"></nz-option>
      <nz-option [nzValue]="24" nzLabel="已退回"></nz-option>
      <nz-option [nzValue]="25" nzLabel="异常关闭"></nz-option>
    </nz-select>
  </div>
  <div class="searchItem">
    <label>赠送状态：</label>
    <nz-select [(ngModel)]="query.state" nzAllowClear nzPlaceHolder="请选择" [nzBackdrop]="true">
<!--      <nz-option [nzValue]="0" nzLabel="下订单记录"></nz-option>-->
      <nz-option [nzValue]="1" nzLabel="待到账"></nz-option>
      <nz-option [nzValue]="2" nzLabel="已到账"></nz-option>
      <nz-option [nzValue]="3" nzLabel="已冻结"></nz-option>
      <nz-option [nzValue]="4" nzLabel="余额不足"></nz-option>
      <nz-option [nzValue]="5" nzLabel="已失效"></nz-option>
    </nz-select>
  </div>
  <div class="searchItem">
    <label>下单时间：</label>
    <nz-range-picker id="startDate" nzFormat="yyyy-MM-dd" [(ngModel)]="query.time"></nz-range-picker>
  </div>
  <div class="searchItem">
    <button nz-button nzType="primary" (click)="queryBtn()">查询</button>
    <button nz-button nzType="default" (click)="resetCondition()">重置</button>
  </div>
</div>
<!--表格-->
<nz-table
  #rowSelectionTable
  nzSize="small"
  nzShowSizeChanger
  nzShowQuickJumper
  nzOuterBordered
  [nzData]="tableData.records"
  [nzPageSizeOptions]="[5, 10, 20, 50, 100]"
  [nzTotal]="tableData.total"
  [(nzPageIndex)]="query.page"
  [(nzPageSize)]="query.pageSize"
  [nzFrontPagination]="false"
  [nzShowTotal]="totalTemplate"
  (nzPageIndexChange)="onPageIndexChange($event)"
  (nzPageSizeChange)="onPageSizeChange($event)"
>
  <thead>
  <tr>
    <th nzAlign="center">订单编号</th>
    <th nzAlign="center">关联活动ID</th>
    <th nzAlign="center">用户身份</th>
    <th nzAlign="center">订单状态</th>
    <th nzAlign="center">赠送爱豆</th>
    <th nzAlign="center">赠送状态</th>
    <th nzAlign="center">赠送时间</th>
    <th nzAlign="center">下单时间</th>
    <th nzAlign="center">成交时间</th>
    <th nzAlign="center" nzWidth="160px">操作</th>
  </tr>
  </thead>
  <tbody>
  <tr *ngFor="let data of rowSelectionTable.data">
    <td nzAlign="center">{{data['okey']}}</td>
    <td nzAlign="center" routerLink="/aisi-recyc/love-send-idol-list" [queryParams]="{activityId: data['activityId']}">
      <a>{{data['activityId']}}</a></td>
    <td nzAlign="center">{{data['userId'] === 0 ? '游客' : '爱思用户'}}</td>
    <td nzAlign="center" [attr.statusColor]="data['orderState']">{{ORDERSTATE[data['orderState']]}}</td>
    <td nzAlign="center">{{data['isPush']===1?data['idol']:'-'}}</td>
    <td nzAlign="center">{{data['isPush']===1?data['userId'] === 0 ? data['status']===5?'已失效':'已冻结' : STATUS[data['status']]:'-'}}</td>
    <td nzAlign="center">{{data['givingTime']}}</td>
    <td nzAlign="center">{{data['createTime']}}</td>
    <td nzAlign="center">{{data['dealTime']}}</td>
    <td nzAlign="center">
      <a routerLink="/aisi-recyc/loveOrderDetails" [queryParams]="{ id: data['orderId'] }" target="_blank">查看订单</a>
    </td>
  </tr>
  </tbody>
</nz-table>

<!-- 分页template -->
<ng-template #totalTemplate let-total>共有 {{ total }} 条</ng-template>

